<!DOCTYPE HTML>
<html>
<head>
    <title>{bbsVo.bbsPost.title}</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap-theme.min.css">
    <link href="/bootstrap/dmeng-2.0.9.css" rel="stylesheet" />
    <link rel="stylesheet" href="/bootstrap/css/community.css">
    <link rel="icon" href="/images/logo.png" type="image/x-icon"/>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js" type="application/javascript"></script>
    <script src="/bootstrap/dmeng-2.0.9.js"></script>
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="google-site-verification" content="QGf2OqDw91EjWtNE07HoLJi0x0G2rIYylk6jn6JEoEQ" />
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-89103576-8"></script>
    <script type="text/javascript" src="/js/bbs.js"></script>
    
    <link rel="stylesheet" href="/editor.md/css/editormd.min.css">
    <link rel="stylesheet" href="/editor.md/css/editormd.preview.min.css">
    <script src="/editor.md/editormd.min.js" type="application/javascript"></script>
    <script src="/editor.md/moment.js" type="application/javascript"></script>
    <script src="/editor.md/lib/marked.min.js"></script>
    <script src="/editor.md/lib/prettify.min.js"></script>
    
</head>
<script type="application/javascript">
    window.onload = function () {
    	var weir_token = $("#weir-token").val();
    	// console.log("----------weir-token--------" + weir_token)
    	if(weir_token == undefined || weir_token.length == 0){
    		weir_token = window.localStorage.getItem("quarkus-bbs-token");
    	}else{
    		window.localStorage.setItem("quarkus-bbs-token", weir_token);
    		$.cookie('weir-cookie-toekn', weir_token, { expires: 360 });
    	}
    	var weir_token_user = $("#weir-token-user").val();
    	// console.log("----------weir-token-user--------" + weir_token_user)
    	if(weir_token_user == undefined || weir_token_user.length == 0){
    		weir_token_user = window.localStorage.getItem("weir-token-user");
    	}else{
    		window.localStorage.setItem("weir-token-user", weir_token_user);
    	}
        /* var closable = window.localStorage.getItem("closable");
        if (closable == "true") {
            window.close();
            window.localStorage.removeItem("closable");
        } */
    }
</script>
<body>
<input type="hidden" id="weir-token" value="{bbsVo.token}">
{#if bbsVo.user??}
<input type="hidden" id="weir-token-user" value="{bbsVo.user.userName}">
{/if}
<div>
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Quarkus先锋论坛</span>
                </button>
                <a class="navbar-brand" href="/">Quarkus先锋论坛</a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <form class="navbar-form navbar-left" action="/" method="get">
                    <div class="form-group">
                        <input type="text" class="form-control" name="search" placeholder="搜索问题">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
                <ul class="nav navbar-nav">
                    <script>
                        function clickNav(label) {
                            gtag('event', 'click', {
                                'event_category': 'LINK',
                                'event_label': label,
                                'transport_type': 'NAV'
                            })
                        }
                    </script>
                    <li each="ad : ">
                        <a href="ad.url" text="ad.title" onclick="clickNav([[ad.title}]])"
                           target="_blank"></a>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    {#if bbsVo.user??}
                    <li>
                        <a href="/publish">发帖</a>
                    </li>
                    <li><a href="/profile/replies">通知 <span class="badge" text="session.unreadCount"></span></a>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">
                            <span>{bbsVo.user.userName}</span>
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="/profile/questions">我的问题</a></li>
                            <li><a href="/logout">退出登录</a></li>
                        </ul>
                    </li>
                    {#else}
                    <li>
                        <a href="#" data-toggle="modal" data-target="#myModal">登录</a>
                    </li>
                    {/if}

                </ul>
            </div>
        </div>
    </nav>

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document" style="margin-top: 200px;wid 300px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">登录注册</h4>
                </div>
                <div class="modal-body" style="text-align:center">
                    <a href="https://gitee.com/oauth/authorize(client_id='e542c33bb680ea612ce21b8efb397274eae34833553bc80bc9ff881425d1b883',redirect_uri=,response_type=code)">
                        <img src="/images/gitee.png">
                    </a>
                    <a href="https://github.com/login/oauth/authorize?client_id=f2bb003d1642d62b8cf5&redirect_uri=http://a881-223-91-168-24.ngrok.io/oauth-github/callback&scope=user&state=weir">
                        <img src="/images/github.png">
                    </a>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid main profile">
    <div class="row">

        <!--左边主要内容-->
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <!--正文-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4 class="question-title"><span>{bbsVo.bbsPost.title}</span></h4>
                <span class="text-desc">
                作者：<span>{bbsVo.bbsPost.user.userName}</span> |
                发布时间：<span>{bbsVo.bbsPost.createDate}</span> |
                阅读数： <span>{bbsVo.bbsPost.viewCount}</span>
            </span>
                <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">

                <!--内容-->
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="question-view">
                    <textarea style="display:none;">{bbsVo.bbsPost.content}</textarea>
                </div>
                <script type="text/javascript">
                    $(function () {
                        editormd.markdownToHTML("question-view", {});
                    });
                </script>

                <!--标签-->

                <!--编辑-->
                <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                {#if bbsVo.user??}
                {#if bbsVo.user.id == bbsVo.bbsPost.user.id}
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <a href="@{'/publish/'+{bbsVo.bbsPost.id}}" class="community-menu">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true">编辑</span>
                    </a>
                </div>
                {/if}
                {/if}
                <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            </div>

            <!--回复-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>
                    <span>{bbsVo.bbsPost.commentCount}</span> 个回复
                </h4>
                <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12 comment-sp">
                {#for comment in bbsVo.bbsPost.commentsBBSs}
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 comments">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object img-rounded" src="{comment.user.profileImageUrl}">
                            </a>
                        </div>
                        <div class="media-body" id="comment-body-{comment.id}">
                            <h5 class="media-heading">
                                <span>{comment.user.userName}</span>
                            </h5>
                            <div id="question-comment-view-{comment.id}"><textarea style="display:none;">{comment.content}</textarea></div>
                            <script type="text/javascript">
			                    $(function () {
			                        editormd.markdownToHTML("question-comment-view-{comment.id}", {});
			                    });
                			</script>
                            <div class="menu">
                                <span class="glyphicon glyphicon-thumbs-up icon"></span>
                                <span data-id="{comment.id}" onclick="collapseComments(this)" class="comment-icon">
                                    <span class="glyphicon glyphicon-comment"></span>
                                    <span>{comment.commentCount}</span>
                                </span>
                                <span class="pull-right">{comment.createDate}</span>
                            </div>
                            <!--二级评论-->
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 collapse sub-comments"
                                 id="comment-{comment.id}">
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				                			<input type="text" class="form-control" placeholder="评论一下……"
                                           id="input-reply-{comment.id}">
                                    <button type="button" class="btn btn-success pull-right" onclick="post_comment(this)"
                                    data-id="{comment.id}" data-postId="{comment.postId}">评论</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {/for}
            </div>

            <!--回复输入框-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>
                    提交回复(登录后可回复)
                </h4>
                {#if bbsVo.user??}
                <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12 comment-sp">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="comment_section">
                    <div class="media">
                        <div class="media-left">
		                    <a href="#">
		                        <img class="media-object img-rounded"
		                             src="{bbsVo.user.profileImageUrl}">
		                    </a>
                        </div>
                        <div class="media-body">
                            <h5 class="media-heading">
                                <span>{bbsVo.user.userName}</span>
                            </h5>
                        </div>
                    </div>
                    <input type="hidden" id="question_id" value="{bbsVo.bbsPost.id}">
                    <div class="form-group" id="question-editor" style="z-index: 2">
	                    <textarea name="content" id="comment_content" style="display:none;"
	                              class="form-control"
	                              cols="30"
	                              rows="10"></textarea>
	                </div>
                    <script type="text/javascript">
	                    $(function () {
	                        var editor = editormd("question-editor", {
	                            width: "100%",
	                            height: 350,
	                            path: "/editor.md/lib/",
	                            toolbarIcons : function() {
	                                // Or return editormd.toolbarModes[name]; // full, simple, mini
	                                // Using "||" set icons align right.
	                                return ["undo", "redo", "|", 
	                                    "bold", "del", "italic", "quote", "ucwords", "uppercase", "lowercase", "|", 
	                                    "code", "preformatted-text", "code-block", "table", "datetime", "html-entities", "|",
	                                    "goto-line", "watch", "preview", "fullscreen", "clear", "search", "|",
	                                    "help", "info"]
	                            },
	                            delay: 0,
	                            watch: true,
	                            placeholder: "开始你的文章吧。。。。",
	                        });
	                    });
	                </script>
                    <button type="button" class="btn btn-success btn-comment" onclick="post_community()">回复</button>
                </div>
		        {/if}
            </div>

        </div>

        <!--右边信息块-->
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>发起人</h4>
                <div class="media">
                    <div class="media-left">
                        <a href="#">
                            <img class="media-object img-rounded"
                                 src="{bbsVo.bbsPost.user.profileImageUrl}">
                        </a>
                    </div>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <span>{bbsVo.bbsPost.user.userName}</span>
                        </h5>
                    </div>
                </div>
            </div>
            <!--相关问题-->
            <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>相关问题</h4>
                <ul class="question-related">
                    <li each="related : ">
                        <a href="@{'/question/'+" text=""></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script src="/js/community.js" type="application/javascript"></script>
<div id="colophon" class="container" role="contentinfo" itemscope="" itemtype="http://schema.org/WPFooter">
<div class="footer">
    <div>Copyright © 2022  豫ICP备2021013020号-1 · All Rights Reserved Powered By <a href="http://www.loveweir.com" target="_blank"> 爱威尔 </a></div>
</div>
<div class="btn-group-vertical floatButton">
	<button type="button" class="btn btn-default" id="goTop" title="去顶部">
		<span class="glyphicon glyphicon-arrow-up"></span>
	</button>
	<button type="button" class="btn btn-default" id="refresh" title="刷新">
		<span class="glyphicon glyphicon-repeat"></span>
	</button>
	<button type="button" class="btn btn-default" id="goBottom" title="去底部">
		<span class="glyphicon glyphicon-arrow-down"></span>
	</button>
</div>
</body>
</html>